<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
	if (sizeof($pages) > 0) {
		if ($paging) echo $paging."<br class='cc' />";
		foreach ($pages as $page) {
			$video = FALSE;
			if ($page['pg_parent'] == 3 && $page['pg_video'] != "") {
				$video = TRUE;
			}
			echo "<div class='".($page['pg_parent'] == 3 && $page['pg_video'] != ""?"video-":"")."pg-item'>";
				if ($video) {
					echo "<div>".parse_youtube_url($page['pg_video'],"embed",400,400)."</div>";
				}
				echo "<h2>";
				echo ($page['pg_parent'] != 3?"<a href='/".$url."/".$page['pg_id']."/'>":"");
				echo $page['pg_title'];
				echo ($page['pg_parent'] != 3?"</a>":"");
				echo "</h2>";
				if ($page['pg_image'] != "" && !$video) {
					echo "<a href='/".$url."/".$page['pg_id']."/'><img src='/uploads/pg/".$page['pg_id']."/small/".$page['pg_image']."' alt='".$page['pg_title']."' title='".$page['pg_title']."' /></a>";
				}
				echo "<br class='cc'/>";
			echo "</div>";
		}
		if ($paging) echo $paging;
	} else {
		echo showmenotice('Список пуст');
	}
?>
